console.log('默认方式加载的脚本')
console.log('document.readyState', document.readyState)
document.addEventListener("DOMContentLoaded", function () {
    console.log('DOMContentLoaded事件触发了')
})
window.addEventListener("load", function () {
    console.log('load事件触发了')
})

document.addEventListener('readystatechange', function (event) {
    console.log('document.readyState', document.readyState)
    if (document.readyState === "loading") {
        console.log('文档正在加载')
    }
    if (document.readyState === "interactive") {
        console.log('文档已被解析，"正在加载"状态结束，但是诸如图像，样式表和框架之类的子资源仍在加载')
    }
    if (document.readyState === "complete") {
        console.log('文档和所有子资源已完成加载')
    }
});